package com.btex.app.adapter;

import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;

import java.util.List;

public class TradePagerAdapter extends PagerAdapter{
	 private List<View> pages;
		public TradePagerAdapter(List<View> lists) {
			this.pages = lists;
		}

	@Override
	public int getCount() {
		return 3;
	}

	@Override
	public boolean isViewFromObject(View arg0, Object arg1) {
		return arg0 == arg1 ;
	}
	@Override
	public void destroyItem(View container, int position, Object object) {
		((ViewPager)container).removeView(pages.get(position));
	}
	@Override
	public Object instantiateItem(View container, int position) {
		try {
			((ViewPager)container).addView(pages.get(position));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return pages.get(position);
	}

}
